<!DOCTYPE html >
<html>
<head>
    <link rel="stylesheet" href="demos.css" type="text/css" media="screen" />
    
    <script src="../libraries/RGraph.common.core.js" ></script>
    <script src="../libraries/RGraph.common.key.js" ></script>
    <script src="../libraries/RGraph.line.js" ></script>
    <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
    <!--[if lt IE 9]><script src="../excanvas/excanvas.js"></script><![endif]-->
    
    <title>A Line chart with gradients</title>
    
    <meta name="description" content="A basic Line chart" />
     
</head>
<body>

    <h1>A stacked, spline line chart</h1>

    <canvas id="cvs" width="600" height="250">[No canvas support]</canvas>
    
    <script>
        $(document).ready(function ()
        {
            var mline = new RGraph.Line({
                id: 'cvs',
                data: [
                       [4,6,12,16,8,4,2,8,18,16,14,16],
                       [2,4,8,4,2,6,6,12,8,10,6,8],
                       [1,3.5,5,3,4,5,6,11,8,9,5,7]
                      ],
                options: {
                    labels: ['Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec'],
                    gutter: {
                        left: 40,
                        top: 35,
                        right: 15,
                        bottom: 20
                    },
                    colors: ['black', 'black', 'black'],
                    filled: {
                        self: true,
                        accumulative: true
                    },
                    fillstyle: ['Gradient(white:red)', 'Gradient(white:blue)', 'Gradient(white:green)'],
                    units: {
                        post: '%'
                    },
                    linewidth: 0.25,
                    spline: !RGraph.ISOLD,
                    title: {
                        self: 'Robert, Daniel and Janices stats',
                        vpos: 0.5
                    },
                    text: {
                        color: '#333',
                        font: 'Arial'
                    },
                    key: {
                        self: ['Robert', 'Daniel', 'Janice'],
                        colors: ['red', 'blue', 'green'],
                        background: 'white',
                        position: {
                            x: 50
                        }
                    },
                    shadow: {
                        offsety: 2,
                        blur: 5
                    },
                    tickmarks: null,
                    background: {
                        grid: {
                            autofit: {
                                numvlines: 11
                            }
                        }
                    },
                    numxticks: 11
                }
            }).on('beforedraw', function (obj)
            {
                RGraph.clear(obj.canvas, 'white');
            })
            .draw()
            .trace({frames: 60})
        })
    </script>

    <p>
        <a href="./">&laquo; Back</a>
    </p>

</body>
</html>